<?php

namespace common\model;

use think\model\RelationModel;

class StepReviewWorkflowRelationModel extends RelationModel
{

    //自动验证
    protected $_validate = [
        ['review_workflow_id', '', '', self::EXISTS_VALIDATE, 'require'],
        ['step_id', '', '', self::EXISTS_VALIDATE, 'require'],
        ['step_workflow_id', '', '', self::EXISTS_VALIDATE, 'require'],
        ['project_template_id', '', '', self::EXISTS_VALIDATE, 'require'],

        ['review_workflow_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['step_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['step_workflow_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['project_template_id', '', '', self::EXISTS_VALIDATE, 'integer'],
    ];

    //自动完成
    protected $_auto = [
        ['uuid', 'create_uuid', self::MODEL_INSERT, 'function'],
    ];

    protected $_validate_after_auto = [
        ['project_template_id,step_workflow_id,step_id,attr_str', '', '', self::MODEL_INSERT, 'unique'],
    ];

}
